The Tab View Component > FTabView.setSelectedIndex()

 

FTabView.setSelectedIndex()

Availability

Flash Player 6.

Usage

myTab_tbv.setSelectedIndex (index)

Parameters

index A number specifying the index of the tab that should be selected within the component.

Returns


Nothing

Description

Specifies the index of the tab that should be selected within the component. If the specified index does not exist, the method call will be ignored.

Example

The tab_example1.fla example file contains an example of using this method.

The following code adds three tabs to the components, sets the second tab as selected, and the traces the selected index value.

myTab_tbv.addItem( "Tab1" );
myTab_tbv.addItem( "Tab2" );
myTab_tbv.addItem( "Tab3" );

myTab_tbv.setSelectedIndex( 1 ); //selects the second item
trace( "Index: " + myTab_tbv.getSelectedIndex( ) ); //traces "Index: 1"

 

See also

FTabView.getSelectedIndex()